function ShowLoginText(userid,username,pwd){
    layer.open({
        type:1,
        title:"用户修改",
        area:["395px","300px"],
        shade: 0.6 //遮罩透明度
        ,maxmin: true //允许全屏最小化
        ,anim: 1 //0-6的动画形式，-1不开启
        ,
        content:$("#loginBox"),
        cancel: function(index, layero){ 
        	  if(confirm('确定要关闭么')){ //只有当点击confirm框的确定时，该层才会关闭
        	    layer.close(index);
        	    $("#loginBox").css("display","none");
        	  }
        	  return false; 
        	} ,
        });
    $("#InputUserid").val(userid);
    $("#InputUsername").val(username);
    $("#InputUserPwd").val(pwd);
}
function ShowDeleteText(id){
    layer.open({
        type:1,
        title:"删除",
        area:["395px","300px"],
        shade: 0.6 //遮罩透明度
        ,maxmin: true //允许全屏最小化
        ,anim: 1 //0-6的动画形式，-1不开启
        ,
        content:$("#deleteBox"),
        cancel: function(index, layero){ 
        	  if(confirm('确定要关闭么')){ //只有当点击confirm框的确定时，该层才会关闭
        	    layer.close(index);
        	    $("#deleteBox").css("display","none");
        	  }
        	  return false; 
        	} ,
        });
    $("#ID").val(id);
}
function ShowTeacherText(teacherid,teachername,pwd,teacherintroduction,teacherphoto){
    layer.open({
        type:1,
        title:"教师修改",
        area:["395px","300px"],
        shade: 0.6 //遮罩透明度
        ,maxmin: true //允许全屏最小化
        ,anim: 1 //0-6的动画形式，-1不开启
        ,
        content:$("#loginBox"),
        cancel: function(index, layero){
            if(confirm('确定要关闭么')){ //只有当点击confirm框的确定时，该层才会关闭
                layer.close(index);
                $("#loginBox").css("display","none");
            }
            return false;
        } ,
    });
    $("#InputTeacherId").val(teacherid);
    $("#InputTeachername").val(teachername);
    $("#InputTeacherPwd").val(pwd);
    $("#InputTeacherIntroduction").val(teacherintroduction);
    $("#InputTeacherPhoto").val(teacherphoto);
}
function ShowClassText(classid,classname,classurl,classnum,classprice,teacherid,placeid){
    layer.open({
        type:1,
        title:"课程修改",
        area:["395px","300px"],
        shade: 0.6 //遮罩透明度
        ,maxmin: true //允许全屏最小化
        ,anim: 1 //0-6的动画形式，-1不开启
        ,
        content:$("#loginBox"),
        cancel: function(index, layero){
            if(confirm('确定要关闭么')){ //只有当点击confirm框的确定时，该层才会关闭
                layer.close(index);
                $("#loginBox").css("display","none");
            }
            return false;
        } ,
    });
    $.ajax({
        url:"../ShowTeacher",
        type:"GET",
        dataType:"json",
        success: function(data) {
            $.each(data, function(index, item) {
                $("#InputTeacher").append(  //此处向select中循环绑定数据
                    "<option value="+item.teacher_id+">" + item.teacher_name+ "</option>");
            });
        },
        error: function(XMLHttpRequest, textStatus, errorThrown) {
            console.log(XMLHttpRequest.status);
            console.log(XMLHttpRequest.readyState);
            console.log(textStatus);
        },
    })
    $.ajax({
        url:"../ShowPlace",
        type:"GET",
        dataType:"json",
        success: function(data) {
            $.each(data, function(index, item) {
                $("#InputPlace").append(  //此处向select中循环绑定数据
                    "<option value="+item.place_id+">" + item.place_name+ "</option>");
            });
        },
        error: function(XMLHttpRequest, textStatus, errorThrown) {
            console.log(XMLHttpRequest.status);
            console.log(XMLHttpRequest.readyState);
            console.log(textStatus);
        },
    })
    $("#InputClassId").val(classid);
    $("#InputClassName").val(classname);
    $("#InputClassUrl").val(classurl);
    $("#InputClassNum").val(classnum);
    $("#InputClassPrice").val(classprice);
    $("#InputTeacher").val(teacherid);
    $("#InputPlace").val(placeid);
}
function ShowPlaceText(placeid,placename,placeintroduction,placephoto){
    layer.open({
        type:1,
        title:"场地修改",
        area:["395px","300px"],
        shade: 0.6 //遮罩透明度
        ,maxmin: true //允许全屏最小化
        ,anim: 1 //0-6的动画形式，-1不开启
        ,
        content:$("#loginBox"),
        cancel: function(index, layero){
            if(confirm('确定要关闭么')){ //只有当点击confirm框的确定时，该层才会关闭
                layer.close(index);
                $("#loginBox").css("display","none");
            }
            return false;
        } ,
    });
    $("#InputPlaceId").val(placeid);
    $("#InputPlaceName").val(placename);
    $("#InputPlaceIntroduction").val(placeintroduction);
    $("#InputPlacePhoto").val(placephoto);
}
function AddTeacherText(){
    layer.open({
        type:1,
        title:"教师添加",
        area:["395px","300px"],
        shade: 0.6 //遮罩透明度
        ,maxmin: true //允许全屏最小化
        ,anim: 1 //0-6的动画形式，-1不开启
        ,
        content:$("#addBox"),
        cancel: function(index, layero){
            if(confirm('确定要关闭么')){ //只有当点击confirm框的确定时，该层才会关闭
                layer.close(index);
                $("#addBox").css("display","none");
            }
            return false;
        } ,
    });
}
function AddPlaceText(){
    layer.open({
        type:1,
        title:"场地添加",
        area:["395px","300px"],
        shade: 0.6 //遮罩透明度
        ,maxmin: true //允许全屏最小化
        ,anim: 1 //0-6的动画形式，-1不开启
        ,
        content:$("#addBox"),
        cancel: function(index, layero){
            if(confirm('确定要关闭么')){ //只有当点击confirm框的确定时，该层才会关闭
                layer.close(index);
                $("#addBox").css("display","none");
            }
            return false;
        } ,
    });
}
function AddClassText(){
    layer.open({
        type:1,
        title:"课程添加",
        area:["395px","300px"],
        shade: 0.6 //遮罩透明度
        ,maxmin: true //允许全屏最小化
        ,anim: 1 //0-6的动画形式，-1不开启
        ,
        content:$("#addBox"),
        cancel: function(index, layero){
            if(confirm('确定要关闭么')){ //只有当点击confirm框的确定时，该层才会关闭
                layer.close(index);
                $("#addBox").css("display","none");
            }
            return false;
        } ,
    });
    $.ajax({
        url:"../ShowTeacher",
        type:"GET",
        dataType:"json",
        success: function(data) {
            $.each(data, function(index, item) {
                $("#teacher_select").append(  //此处向select中循环绑定数据
                    "<option value="+item.teacher_id+">" + item.teacher_name+ "</option>");
            });
        },
        error: function(XMLHttpRequest, textStatus, errorThrown) {
            console.log(XMLHttpRequest.status);
            console.log(XMLHttpRequest.readyState);
            console.log(textStatus);
        },
    })
    $.ajax({
        url:"../ShowPlace",
        type:"GET",
        dataType:"json",
        success: function(data) {
            $.each(data, function(index, item) {
                $("#place_select").append(  //此处向select中循环绑定数据
                    "<option value="+item.place_id+">" + item.place_name+ "</option>");
            });
        },
        error: function(XMLHttpRequest, textStatus, errorThrown) {
            console.log(XMLHttpRequest.status);
            console.log(XMLHttpRequest.readyState);
            console.log(textStatus);
        },
    })
}
function ShowDeleteText2(bookid){
    layer.open({
        type:1,
        title:"用户删除",
        area:["395px","300px"],
        shade: 0.6 //遮罩透明度
        ,maxmin: true //允许全屏最小化
        ,anim: 1 //0-6的动画形式，-1不开启
        ,
        content:$("#deleteBox"),
        cancel: function(index, layero){ 
        	  if(confirm('确定要关闭么')){ //只有当点击confirm框的确定时，该层才会关闭
        	    layer.close(index);
        	    $("#deleteBox").css("display","none");
        	  }
        	  return false; 
        	} ,
        });
    $("#bookid").val(bookid);
}
function ShowCommodityText(book_id,title,author,publisher,publishing_time,book_price,category_id,inventory,description){
    layer.open({
        type:1,
        title:"商品修改",
        area:["395px","600px"],
        shade: 0.6 //遮罩透明度
        ,maxmin: true //允许全屏最小化
        ,anim: 1 //0-6的动画形式，-1不开启
        ,
        content:$("#loginBox"),
        cancel: function(index, layero){ 
        	  if(confirm('确定要关闭么')){ //只有当点击confirm框的确定时，该层才会关闭
        	    layer.close(index);
        	    $("#loginBox").css("display","none");
        	  }
        	  return false; 
        	} ,
        });
    $("#InputBookid").val(book_id);
    $("#InputTitle").val(title);
    $("#InputAuthor").val(author);
    $("#InputPublisher").val(publisher);
    $("#InputPublishingTime").val(publishing_time);
    $("#InputBookPrice").val(book_price);
    $("#InputCategoryId").val(category_id);
    $("#InputInventory").val(inventory);
    $("#InputDescription").val(description);
}
